<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = prompt('请输入邮箱')
        var reg = /^[0-9a-zA-Z]{4,16}@(qq|163|126|sina)\.(com|cn|net)/
        if(reg.test(str)){
            alert('登录成功')
        }else{
            alert('邮箱格式错误')
        }
    </script>
</body>
</html>